<UserControl x:Class="GeniusTetris._3D.View3DUC"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Loaded="OnLoaded"
    >
  <UserControl.Resources>
    <Storyboard x:Key="myStoryBoard">
      <DoubleAnimation
        Storyboard.TargetName="rotation" 
        Storyboard.TargetProperty="Angle" 
        From="0" To="360" Duration="0:0:10" RepeatBehavior="Forever"/>
      <DoubleAnimation
        Storyboard.TargetName="rotation1" 
        Storyboard.TargetProperty="Angle" 
        From="0" To="360" Duration="0:0:8" RepeatBehavior="Forever"/>
      <DoubleAnimation
        Storyboard.TargetName="rotation2" 
        Storyboard.TargetProperty="Angle" 
        From="0" To="360" Duration="0:0:7" RepeatBehavior="Forever"/>
    </Storyboard>
  </UserControl.Resources>
  <!--<UserControl.Triggers>
    <EventTrigger RoutedEvent="FrameworkElement.Loaded">
      <EventTrigger.Actions>
        <BeginStoryboard>
          <Storyboard Name="myStoryBoard">
            <DoubleAnimation
              Storyboard.TargetName="rotation" 
              Storyboard.TargetProperty="Angle" 
              From="0" To="360" Duration="0:0:5" RepeatBehavior="Forever"/>
            <DoubleAnimation
              Storyboard.TargetName="rotation1" 
              Storyboard.TargetProperty="Angle" 
              From="0" To="360" Duration="0:0:4" RepeatBehavior="Forever"/>
            <DoubleAnimation
              Storyboard.TargetName="rotation2" 
              Storyboard.TargetProperty="Angle" 
              From="0" To="360" Duration="0:0:3" RepeatBehavior="Forever"/>
          </Storyboard>
        </BeginStoryboard>
      </EventTrigger.Actions>
    </EventTrigger>
  </UserControl.Triggers>-->

  <Viewbox Stretch="Uniform">
    <Viewport3D Grid.Row="0" Name="TheViewport" Height="100" Width="100">
      <Viewport3D.Camera>
        <PerspectiveCamera 	  
         LookDirection="0, 0, -50"
         UpDirection="0, 1, 0"
         NearPlaneDistance="1" 
         FarPlaneDistance="100"
         Position="0, 0, 8" 
       FieldOfView="60" >
          <PerspectiveCamera.Transform>
            <Transform3DGroup>
            <RotateTransform3D>
              <RotateTransform3D.Rotation>
                <AxisAngleRotation3D  x:Name="rotation" Angle="0" Axis="0,0,1" />
              </RotateTransform3D.Rotation>
            </RotateTransform3D>
            <RotateTransform3D>
              <RotateTransform3D.Rotation>
                <AxisAngleRotation3D  x:Name="rotation1" Angle="0" Axis="0,1,0" />
              </RotateTransform3D.Rotation>
            </RotateTransform3D>
            <RotateTransform3D>
              <RotateTransform3D.Rotation>
                <AxisAngleRotation3D  x:Name="rotation2" Angle="0" Axis="1,0,0" />
              </RotateTransform3D.Rotation>
            </RotateTransform3D>
            </Transform3DGroup>
          </PerspectiveCamera.Transform>
        </PerspectiveCamera>
      </Viewport3D.Camera>
      <ModelVisual3D>
        <ModelVisual3D.Content>
          <Model3DGroup>
            <!--<DirectionalLight Direction="0,0,-50" Color="White" />-->
            <!--<DirectionalLight Direction="0,0,-50" Color="Red" />-->
            <AmbientLight Color="White" />
          </Model3DGroup>
        </ModelVisual3D.Content>
      </ModelVisual3D>
      <ModelVisual3D x:Name="topModel">
        <ModelVisual3D.Transform>
          <Transform3DGroup>
            <TranslateTransform3D x:Name="myTranslateTransform3D" OffsetX="-1" OffsetY="-1" OffsetZ="0.50" />
            <!--<RotateTransform3D>
              <RotateTransform3D.Rotation>
                <AxisAngleRotation3D  x:Name="rotation" Angle="0" Axis="0,0,1" />
              </RotateTransform3D.Rotation>
            </RotateTransform3D>
            <RotateTransform3D>
              <RotateTransform3D.Rotation>
                <AxisAngleRotation3D  x:Name="rotation1" Angle="0" Axis="0,1,0" />
              </RotateTransform3D.Rotation>
            </RotateTransform3D>
            <RotateTransform3D>
              <RotateTransform3D.Rotation>
                <AxisAngleRotation3D  x:Name="rotation2" Angle="0" Axis="1,0,0" />
              </RotateTransform3D.Rotation>
            </RotateTransform3D>-->
          </Transform3DGroup>
        </ModelVisual3D.Transform>

      </ModelVisual3D>
    </Viewport3D>
  </Viewbox>
</UserControl>
